use thiserror::Error;

/// FTP系统通用错误类型
#[derive(Error, Debug)]
pub enum FtpError {
    #[error("Database error: {0}")]
    Database(#[from] sqlx::Error),
    
    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),
    
    #[error("Authentication error: {0}")]
    Authentication(String),
    
    #[error("Permission denied: {0}")]
    PermissionDenied(String),
    
    #[error("File not found: {0}")]
    FileNotFound(String),
    
    #[error("Transfer error: {0}")]
    TransferError(String),
    
    #[error("Configuration error: {0}")]
    ConfigError(String),
    
    #[error("Plugin error: {0}")]
    PluginError(String),
    
    #[error("Network error: {0}")]
    NetworkError(String),
    
    #[error("Protocol error: {0}")]
    ProtocolError(String),
}

pub type Result<T> = std::result::Result<T, FtpError>;
